//
//  ZWLViewController.m
//  ZWLScanView
//
//  Created by zjy on 05/21/2018.
//  Copyright (c) 2018 zjy. All rights reserved.
//

#import "ZWLViewController.h"
#import <ZWLScanView/ZWLScanView-umbrella.h>

@interface ZWLViewController ()<ZWLScanViewDelegate>
@property (weak, nonatomic) IBOutlet ZWLScanView *scanView;

@end

@implementation ZWLViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    
    [self.scanView setupWithDelegate:self];
    NSLog(@"did setup");
    [self.scanView beginScan];
    NSLog(@"did beginScan");
    
}
- (IBAction)startAction:(id)sender {
    
    [self.scanView beginScan];
    
}


- (IBAction)stopAction:(id)sender {
    [self.scanView endScan];
}


#pragma mark - ZWLScanViewDelegate
- (void)scanView:(ZWLScanView *)scanView DidCaptureDataStr:(NSString *)dataStr {
    
    NSLog(@"获取到扫码的结果：%@", dataStr);
    [scanView endScan];
    
}

@end
